package com.xiemulei.gulimall.product.api;

import com.xiemulei.common.utils.R;
import com.xiemulei.gulimall.product.service.SkuInfoService;
import com.xiemulei.gulimall.product.vo.SkuItemVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;

@RestController
@RequestMapping("/product")
public class ItemApi {

    @Resource
    SkuInfoService skuInfoService;

    @GetMapping("/{skuId}")
    public R skuItem(@PathVariable Long skuId) {

        SkuItemVo skuItemVo = skuInfoService.item(skuId);
        return R.ok().put("item", skuItemVo);
    }
}
